/*******************************************************************************
 * Copyright (c) 2007 TOPCASED. All rights reserved. This program
 * and the accompanying materials are made available under the terms of the
 * Eclipse Public License v1.0 which accompanies this distribution, and is
 * available at http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors: Topcased contributors and others - initial API and implementation
 *******************************************************************************/
/**
 * This is a fork of the UML2Java Plug-in developed by Topcased and released under
 * the Eclipse EPL License. http://www.eclipse.org/legal/epl-v10.html
 * In accordance with the license, I have forked the UML2Java plugin and have adapted
 * it to suit the needs of a UML2QoS instrumentation code generator for PHP.
 * 
 * @author Alexandru Burdusel
 */
package org.topcased.uml2qos.log;

import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Status;
import org.topcased.uml2qos.GenQosPlugin;

/**
 * Class that is used to generate error message in the error log of Eclipse
 * @author Ariel RAMPHUL (Sopra Group - Toulouse)
 */
public final class Uml2QosLog
{
    private static ILog sLog;

    /**
     * Default constructor
     */
    private Uml2QosLog()
    {
    }

    static
    {
        sLog = GenQosPlugin.getDefault().getLog();
    }

    /**
     * Log a message
     * @param severity is the status of the message (0=OK, 1=INFO, 2=WARNING, 4=ERROR, 8=CANCEL)
     * @param message is the text to log
     */
    public static void log(int severity, String message)
    {
        //OK 0
        //INFO 1
        //WARNING 2
        //ERROR 4
        //CANCEL 8
        Status status = new Status(severity, GenQosPlugin.PLUGIN_ID, Status.OK, message, null);
        sLog.log(status);
    }

}
